package org.shiwen.week11.answer;

public class Student {
    private String name;
    private int age;

    public Student() {
    }

    public String getName() {
        return name;
    }

    public static boolean isValidName(String name){
        if(name.length()<2 || name.length()>6){
            return false;
        }
        return true;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public static boolean isValidAge(int age){
        if(age<18||age>30){
            return false;
        }
        return true;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public String showInfo() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
